	<div>
<table cellspacing="0"  border=1>

{% if not factura.total %}
	<tr><th colspan=8>Presupuesto aún no realizado</th></tr>
{% else %}

	<tr><th colspan=8>Cuenta corriente
{% if factura.neto and not factura.saldo  %}
	(Factura saldada)
{% endif %}
{% if not factura.fecha_presupuesto %}
: falta enviar presupuesto
{% endif %}
	</th></tr>

<tbody>
<tr class="row2">
<tr>
<th rowspan=2>Fecha</th>
<th rowspan=2>Concepto</th>
<th colspan=3>Remunerativo</th>
<th colspan=3>No Remunerativo</th>
<th rowspan=2>Comprobante</th>
</tr>

<tr>
<th>Debe</th>
<th>Haber</th>
<th>Saldo</th>

<th>Debe</th>
<th>Haber</th>
<th>Saldo</th>

</tr>
</thead>

<tr class="{% cycle "row1" "row2" as rows %}">
	<td>{{factura.fecha_contratacion|date:"d/m/Y"}}</td>
	<td>Total a cobrar en  {{factura.cuotas}} cuotas</td>
	<td>{{factura.neto}}</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>{{factura.no_remunerativo}}</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
</tr>


{% for cuota in factura.cobros.all %}
	{% if cuota.cobro.fecha %}
<tr class="{% cycle rows %}">
	<td>{{cuota.cobro.fecha|date:"d/m/Y"|default_if_none:"&nbsp;"     }}</td>
	<td>Cobranza <a target="_blank" class="button" href="/empresa/admin/ventas/cobro/{{cuota.cobro.id}}/">Editar</a>
</td>
	<td>&nbsp;</td>
	<td>{{cuota.importe}}</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>{{cuota.no_remunerativo}} {% if cuota.no_remunerativo %}{% if cuota.rendido %}Rendido{%else %}A rendir {% endif %}{% endif %}</td>
	<td>&nbsp;</td>
	<td>{{cuota.cobro.comprobante|default_if_none:"&nbsp;"     }}</td>
</tr>

{% endif %}


{% endfor %}

	{% if factura.saldo and False %}
	<tr class="{% cycle rows %}">
		<td></td>
		<td colspan=5>
			<a class="button" target="_blank" href='/empresa/admin/ventas/cobro/add?factura={{factura.id}}'>Agregar cobro</a>
		</td>
	</tr>
	{% endif %}
	
<tr class="{% cycle rows %}">
	<td></td>
	<td>Totales</td>
	<td>{{factura.neto}}</td>
	<td>{{factura.cobrado}}</td>
	<td>{{factura.saldo}}</td>
	<td>{{factura.no_remunerativo}}</td>
	<td>{{factura.cobrado_no_remunerativo}}</td>
	<td>{{factura.saldo_no_remunerativo}}</td>
	<td>&nbsp;</td>
</tr>

</tbody>
</table>

{% endif %}

</div>